export class Tab{
        constructor(){
            this.h3 = $(".title1").find("h3");
            this.ul = $(".kemu");
            this.doctor = $(".doctor")
            this.img = this.doctor.find("img")
            this.hs = $(".title2").find("h3")
            this.ull = $(".content1").find("ul")
            this.serve = $(".serve")
            this.gonggao = $(".gonggao")
			this.title = $(".title").find("span")
			this.div = $(".lianjie").find("div")
			this.friend = $(".friend")
			this.flink = $(".flink")

            this.init()
        }
        init(){
            var that = this;
            this.h3.on("click",function(){
                that.h3.removeClass("active").eq($(this).index()).addClass("active");
				if($(this).index()==1){
					that.ul.stop().hide()
					that.doctor.stop().show()
					that.img.hover(function(){
						if(this.className=="zonghe"){
							$(this).attr("src","images/icon_4_light.png")
						}if(this.className =="ertong"){
							$(this).attr("src","images/icon_3_light.png")
							
						}
							},function(){
						if(this.className=="zonghe"){
							$(this).attr("src","images/icon_4.png")
						}
						if(this.className =="ertong"){
							$(this).attr("src","images/icon_3.png")
						}
					})
				
				}
				if($(this).index()==0){
					that.ul.stop().show()
					that.doctor.stop().hide()
					
				}
				
            })
            
            var that = this;
            that.hs.on("click",function(){
                that.hs.removeClass("active").eq($(this).index()).addClass("active");
            	that.ull.stop().hide().eq($(this).index()).stop().show();
            })
            
            that.title.on("click",function(){
                that.title.removeClass("active").eq($(this).index()).addClass("active");
            	that.div.stop().hide().eq($(this).index()).stop().show();
            	
            })
            
        }
        
        
    }